﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace VirusCleaner.BugReport
{
    public partial class BugReport : Form
    {
        private readonly string[] _args;
        //Application
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            if (args.Length > 0)
            {
                Application.Run(new BugReport(args));                
            }
            else
            {
                MessageBox.Show("此应用程序在崩溃后运行并向程序发行商报告相应问题。无法被直接运行。",
                    "BugReport",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );

            }
        }
        public BugReport(string[] args)
        {
            _args = args;
            InitializeComponent();
            label2.Text = String.Format(label2.Text,System.IO.Path.GetFileName(args[0]));
        }

        private void BugReportLoad(object sender, EventArgs e)
        {
            ChkHelperCheckedChanged(sender,e);
            this.Top += 50;
        }

        private void ChkHelperCheckedChanged(object sender, EventArgs e)
        {
            if (chkHelper.Checked)
            {
                while (this.Height != this.MaximumSize.Height)
                {
                    this.Height++;
                    if(this.Height % 2== 0)
                    {
                        this.Top--;
                    }
                }
            }
            else
            { 
            while(this.Height != this.MinimumSize.Height)
            {
                 this.Height--;
                 if (this.Height % 2 == 0)
                 {
                     this.Top++;
                 }
            }
            }
                
        }

        private void BtnCloseClick(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
